
package demo.issuetracker.controller;

import demo.issuetracker.model.CustomIdentity;
import demo.issuetracker.entity.User;
import demo.issuetracker.entity.Issue;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.seam.annotations.Create;
import org.jboss.seam.annotations.In;

import org.jboss.seam.annotations.web.RequestParameter;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.UIData;
import javax.faces.event.ActionEvent;
import java.util.Map;
import java.util.List;

/**
 * Glue code to bind View Issue Service with the view framework (Seam). This class contains
 * a default implementation of the action methods. Please avoid reimplmenting the action methods in this class.
 * The purpose of this class is to declare properties which can be bound to the UI.
 * 
  * This page displays the details of an issue.
  *
 * Automatically generated by clickframes
 * 
 * @author Vineet Manohar
 */
public abstract class GeneratedViewIssueController extends Controller {
    @In("#{issueDao}") 
    protected demo.issuetracker.dao.IssueDao issueDao;

    @In("#{issueService}") 
    protected demo.issuetracker.entity.service.IssueService issueService;


    public User getLoggedInUser() {
        return identity.getUser();
    }



    /** $!Issue - PARAM_PRIMARY_KEY */
    protected Issue issue;

    /** 
     * Get Issue
     *  
     * @return Issue
     */
    public Issue getIssue() {
       return this.issue;
    }

    /**
     * Set Issue
     *
     * @param issue
     */
    public void setIssue(Issue issue) {
        this.issue = issue;
    }


    protected void initIssue() {
        // if ${outputList.id} has not been initialized, initialize it now
        if (getIssue() == null) {
            setIssue(loadIssue());
        }
        
     }

    protected Issue loadIssue() {
        return issueDao.findByPrimaryKey(issueId);
    }

    protected void reloadIssue() {
        clearIssue();
        loadIssue();
    }

    protected void clearIssue() {
        setIssue(null);
    }
 
    
	@SuppressWarnings("unused")
	private static final Log logger = LogFactory.getLog(GeneratedViewIssueController.class);

	@In
	protected CustomIdentity identity;

    @Create
    public void init() {


        // initialize all file inputs
          // all inputs initialized here 
    }

	@RequestParameter


    /** $!Unique identifier of issue to be viewed. */
    private String issueId;

    /** 
     * Get Issue ID
     *  
     * @return Issue ID
     */
    public String getIssueId() {
       return this.issueId;
    }

    /**
     * Set Issue ID
     *
     * @param issueId
     */
    public void setIssueId(String issueId) {
        this.issueId = issueId;
    }




	/**
	 * This method should be called before the page is loaded
	 * 
	 * All the page parameters should be consumed in this method
	 */    
    public String processPageParameters() {
        initIssue();


          // if you need to add more code, override this method in the child class

        return null;
    }

 



 
 
 

 
   /**
    * Resolve Issue
    *
    *     * Automatically generated by clickframes
    */
   public abstract FormResolveOutcome formResolve();




    private static final long serialVersionUID = 1L;

    /**
     * different legal outcomes for Resolve Issue 
     * 
     * This page displays the details of an issue.
     */
     public enum FormResolveOutcome {
        /** 
         * Issue Resolved
         */ 
        issueResolved    
    }
  }// clickframes::version=4209468401::clickframes